package org.jeecg.modules.xl.store.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.xl.store.entity.XlCustomerStoreInfo;

/**
 * @Description: 客户门店信息
 * @Author: jeecg-boot
 * @Date:   2024-10-24
 * @Version: V1.0
 */
public interface XlCustomerStoreInfoMapper extends BaseMapper<XlCustomerStoreInfo> {

    List<XlCustomerStoreInfo> selectStoresInDepartName(String departnames);
    
    @Select("" +
            "SELECT  " +
            "    MAX(SUBSTRING(SUBSTRING_INDEX(store_code, #{pre}, -1), 1)) AS maxNumber " +
            "FROM  " +
            "    xl_customer_store_info " +
            "WHERE  " +
            "    is_deleted = 0 and store_code LIKE concat('%',#{pre},'%') " +
            "")
    String queryMaxCodeNumber(String pre);
}
